package com.dubbo2.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo2.bean.User;
import com.dubbo2.face.DemoService;


@RestController
@RequestMapping("/")
public class DemoController {
    @Reference(version = "1.0.0")
    private DemoService demoService;

    @GetMapping("hello")
    public String hello() {
        return demoService.sayHello("hello springboot and dubbo");
    }

    @GetMapping("user")
    public User user() {
        return demoService.findUser();
    }

}
